﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Apodidae.Domain.Entity;

namespace Apodidae.Core
{
    public interface IUserService
    {
        UserInfo GetUserByUserId(string userId);
        UserInfo GetUserByLoginId(string loginId);

        void SetUserAuthIn(string loginName, string cookieDomain);
        void SetAuthOut(string cookieDomain);

        UserInfo GetCurrentPerson();
        AutherResult ValidateLogin(string loginId, string pwd, string domainName);
        void SuspendUser(string userId);
        UserInfo CreateUser(string loginId, string pwd, string email, string realName,
                            UserType uType);

        void ChangePassword(UserInfo user, string newPwd);
        bool ComparePassword(string orginalPwd, string pwdFromDb);

        UserInfo Save(UserInfo entity);
        void SaveOrUpdate(UserInfo entity);
        void Delete(UserInfo entity);
    }
}
